﻿using System;
using System.Windows.Forms;
using ceTerminal.ceMessenger;

namespace ceTerm
{
    public partial class WebBrowser : Form
    {
        ceMessenger ce = new ceMessenger();
        public WebBrowser(string URL, bool IsLocalAddress, string Header)
        {
            InitializeComponent();
            wb.Url = new Uri(IsLocalAddress ? LocalPath() : string.Empty + URL);
            this.Text = Header;
        }

        private string LocalPath()
        {
            return ce.Url.ToString().Replace(ce.Url.Split('/')[ce.Url.Split('/').Length - 1], "");
        }
    }
}